<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button onclick="createImg()">点击添加图片</button>
    <script type="text/javascript">
        function createImg(){
            var img = document.createElement("img");
            img.src = "./dom树.png"
            document.getElementsByTagName("body")[0].appendChild(img);
        }

    </script>
</body>
</html>